<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * 课程控制器
 */
class Kecheng extends AdminBase
{
    
    /**
     * 课程列表
     */


    public function kechengList()
    {
        
        $this->assign('list', $this->logicKecheng->getKechengList());
        
        return $this->fetch('kecheng_list');
    }
    // public function kechengList()
    // {
        
    //     $this->assign('list', $this->logicKecheng->getKechengList());
        
    //     return $this->fetch('kecheng_list');
    // }
    
    /**
     * 课程添加
     */
    public function kechengAdd()
    {
        
        IS_POST && $this->jump($this->logicKecheng->kechengEdit($this->param));
        
        return $this->fetch('kecheng_edit');
    }
    
    /**
     * 课程编辑
     */
    public function kechengEdit()
    {
        
        IS_POST && $this->jump($this->logicKecheng->kechengEdit($this->param));
        
        $info = $this->logicKecheng->getKechengInfo(['id' => $this->param['id']]);
        
        $this->assign('info', $info);
        
        return $this->fetch('kecheng_edit');
    }
    
    /**
     * 课程删除
     */
    public function kechengDel($id = 0)
    {
        
        $this->jump($this->logicKecheng->kechengDel(['id' => $id]));
    }
}
